let http = require("http")

let server = http.createServer(function (request, response) {

  // console.log(request.url);
  response.writeHead(200, {
    "Content-Type": "text/html;charset=utf-8"
  })
  switch (request.url) {
    case "/":
      response.write("首页");
      break;
    case "/login.html":
      response.write("登录页面");
      break;
    case "/register.html":
      response.write("注册页面");
      break;
  }

  response.end()
})

server.listen(8080, function () {
  console.log("服务器已经启动, 监听端口号为8080");
})